package com.denlaku.longan.service.impl;

import com.denlaku.longan.qo.DataPermQuery;
import com.denlaku.longan.repository.DataTagRelRepository;
import com.denlaku.longan.service.DataTagRelService;
import com.denlaku.longan.vo.DataTagRel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tianx
 */
@Slf4j
@Service
public class DataTagRelServiceImpl implements DataTagRelService {
    @Autowired
    private DataTagRelRepository dataTagRelRepository;

    @Override
    public void batchAdd(List<DataTagRel> relList) {
        if (CollectionUtils.isNotEmpty(relList)) {
            dataTagRelRepository.batchAdd(relList);
        }
    }

    @Override
    public List<DataTagRel> list(DataPermQuery query) {
        return dataTagRelRepository.list(query);
    }

    @Override
    public void delete(DataPermQuery query) {
        dataTagRelRepository.delete(query);
    }
}
